import request from '@/plugins/request'
export function getRolesList () {
  return request({
    url: '/roles',
    method: 'get'
  })
}
export function setRights (params) {
  return request({
    url: `/roles/${params.roleId}/rights`,
    method: 'post',
    data: { rids: params.rids }
  })
}
export function addRole (data) {
  return request({
    url: '/roles',
    method: 'post',
    data
  })
}
export function editdRole (params) {
  return request({
    url: `/roles/${params.roleId}`,
    method: 'put',
    data: params.data
  })
}
export function delRole (params) {
  return request({
    url: `/roles/${params}`,
    method: 'delete'
  })
}
